<extend name="template/base_index"/>

<block name="area_header">
    <link rel="stylesheet" type="text/css" media="all" href="__CSS__/wxshop.css">
    <link type="text/css" rel="stylesheet" src="__CDN__/jquery-uploadify/3.2.1/uploadify.css"/>
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
    <script type="text/javascript" src="__CDN__/jquery-qrcode/v1.0/jquery.qrcode.min.js"></script>
    <style>
    </style>

</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <h4>赠无限商品列表：<strong>{$store.name}</strong></h4>
            <!-- 操作按钮 -->
            <div class="btn-controls">
                <a class="btn btn-danger btn-sm ajax-post confirm" href="{:U('admin/zengwuxian/bulkDelete')}"
                   target-form="selectitem"><i class="fa fa-trash-o"></i>删除选中商品</a>
            </div>
            <table class="table table-striped table-hover  table-condensed">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');"/>ID
                    </th>
                    <th>
                        商品名称
                    </th>
                    <th>
                        产品详情
                    </th>
                    <th>
                        发布者
                    </th>
                    <th>
                        发布时间
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                </thead>
                <tbody>
                <empty name="list">
                    <tr>
                        <td colspan="5" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    <else/>
                    <volist name="list" id="vo">
                        <tr>
                            <!--ID-->
                            <td>
                                <input type="checkbox" value="{$vo.pid}" name="pid[]" class="selectitem"/>{$vo.pid}
                            </td>
                            <!--商品名称-->
                            <td class="text-ellipsis">{$vo.product_name}<br/>
                                <a href="{:U('Admin/Zengwuxian/detail',array('pid'=>$vo['pid']))}" >
                                    <img class="thumbnail" src="{:getImgUrl($vo['pid'])}" width="60"/></a>
                            </td>
                            <!--产品详情-->
                            <td>
                                <a href="{:U('Admin/Zengwuxian/detail',array('pid'=>$vo['pid']))}"
                                   class="btn btn-sm btn-link">{$vo.detail}</a>
                                <!--发布者-->
                            <td class="text-ellipsis"> <a href="{:U('Admin/CustomerInfo/index',array('id'=>$vo['uid']))}">{$vo.nickname}</a><br/>
                                <a href="{:U('Admin/CustomerInfo/index',array('id'=>$vo['uid']))}">
                                    <img class="thumbnail" src="{:getImgUrl($vo['head'])}" width="60"/></a>
                            </td>
                            <!--发布者时间-->
                            <td class="text-ellipsis">{$vo.createtime|date="y-m-d H:i:s",###}<br/>
                            </td>

                            <!--操作-->
                            <td>
                                <a href="__CONTROLLER__/del/pid/{$vo.pid}"
                                   class="btn btn-danger btn-sm ajax-get confirm" target="_self"><i
                                        class="fa fa-trash-o"></i> 删除</a>
                            </td>

                        </tr>

                    </volist>
                </empty>
                </tbody>
            </table>
            <div>{$page}</div>

        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">
    <script type="text/javascript">
        $(function () {
            $(".onshelf").click(function () {
                $("#searchFormSubmit").click();
            });


            $("a[data-toggle='popover']").click(function () {
                var link = "{:C('SITE_URL')}/index.php/Shop/Index/spxq?id={$vo.id}";

                $('#qrcode').qrcode({width: 125, height: 125, text: link});
            });

        })
    </script>
</block>